<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="__PUBLIC__/Admin/images/Admin_css.css" type=text/css rel=stylesheet>

<import file= "Admin.js.admin,Admin.js.Ajax"/> 
<link rel="StyleSheet" href="__PUBLIC__/css/dtree.css" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/js/dtree2.js"></script>
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/bootstrap.min.js"></script>
<script>var mypath='__PUBLIC__/js/';</script>
<style> 
.classlist {float:left;margin:0;padding:0;}
.classlist ul {float:left;margin:0;padding:0;}
.classlist li {margin:0;padding:0;padding:3px 0;border-bottom:1px solid #ffffff;}
.classlist li span {float:right;margin-top:-3px;}
.classlist .bigclass {font-weight:bold;clear:both;list-style:none;margin:5px 0;}
.classlist .yaoclass {font-weight:normal;list-style:none;padding-left:10px;}
</style>
<title>管理员管理</title>
</head>
<body>
<script language="javascript">
function chk(){
		var a=document.getElementById('name');
		if(a.value==""){
		alert('组名称不能为空!');
		a.focus();
		return false;
	}
}
</script> <form action="__URL__/dogroupadd" method="post" onSubmit="return chk();">
<table width="600" border="0" align="center" cellpadding="3" cellspacing="2" bgcolor="#FFFFFF" class="admintable">  <tr>
    <td colspan="2" class="admintitle"> 添加组</td>
  </tr>
  <tr>
    <td height="25" colspan="2" bgcolor="f7f7f7" style="font-weight:bold;">注：该系统是rbac权限体系，无专业知识请默认别乱操作</td>
    </tr>
  <tr>
    <td width="28%" height="25" bgcolor="f7f7f7">组名称：</td>
    <td width="72%" height="25" bgcolor="f7f7f7"><input name="name" type="text" size="30" id="name" ></td>
  </tr>
  <tr>
    <td height="25" bgcolor="f7f7f7">栏目权限：</td>
    <td height="25" bgcolor="f7f7f7">
	<script type="text/javascript">
		<!--

		d = new dTree('d');
		d.add(0,-1,'管理栏目权限');
<volist name="node_tree" id="vo">
		d.add({$vo.id},{$vo.pid},'<input name="manageids[]" type="checkbox" value="{$vo.id}" id="t{$vo.id}" pId="t{$vo.pid}">{$vo.title}');
</volist>
        document.write(d);
		
		


		//-->
	</script></td>
  </tr>
  <tr>
    <td height="25" bgcolor="f7f7f7">内容权限：</td>
    <td height="25" bgcolor="f7f7f7">
    <script>
    t = new dTree('t');
		t.add(0,-1,'管理内容权限');
<volist name="type_tree" id="vo">
		t.add({$vo.typeid},{$vo.fid},'<input name="typeids[]" type="checkbox" value="{$vo.typeid}" id="l{$vo.typeid}" pId="l{$vo.fid}">{$vo.typename}');
</volist>
        document.write(t);
		
		$("input[type='checkbox']").click(function(){  
                   var pId=this.id;
				   var id =  $(this).attr("pId");
				  //alert(id); 
                   var checked=this.checked;  
				   //$("input[id='"+ id +"']").attr("checked",checked);  
                  //findparent(id);
				  findChild(pId);
				  //选中父节点
				  function findparent(id){
				   var children=$("input[id='"+ id +"']").attr("checked",checked);  
                        if(children.length>0){  
                               children.each(function(){
								   var tid =  $(this).attr("pId");
                                   findparent(tid);  
                       });  
                        }  	  
				 }  
				 //选中子节点
                  function findChild(pId){  
                        var children=$("input[pId='"+pId+"']").attr("checked",checked);  
                        if(children.length>0){  
                               children.each(function(){  
                                   findChild(this.id);  
                       });  
                        }  
         }  
      }); 
		</script>

    </td>
  </tr>
  <tr>
    <td height="25" bgcolor="f7f7f7">状态</td>
    <td height="25" bgcolor="f7f7f7">
      <select name="status" id="level2">
        <option value="0">禁用</option>
        <option value="1" selected>启用</option>
      </select></td>
  </tr>
  <tr>
    <td height="25" bgcolor="f7f7f7">备注</td>
    <td height="25" bgcolor="f7f7f7"><label for="textarea"></label>
      <textarea name="remark" id="textarea" cols="45" rows="5"></textarea></td>
  </tr>
  <tr>
    <td height="25"  bgcolor="f7f7f7" align="left"></td><td height="25" bgcolor="f7f7f7"><input type="submit" name="Submit" class="btn btn-success" value="添加">&nbsp;&nbsp;<input name="Submit22" type="button" class="btn btn-info" onClick="history.go(-1)"  value="返 回"></td>
  </tr>

</table>
  </form>
</body>
</html>